package main

import (
	"io/ioutil"
	"time"

	"gopkg.in/yaml.v2"
)

type Configure struct {
	PromUrls []string      `yaml:"prometheus"`
	Interval time.Duration `yaml:"scrape_interval"`
}

func LoadConfig(fileName string) (*Configure, error) {
	config := Configure{}
	content, err := ioutil.ReadFile(fileName)
	if err != nil {
		return &config, err
	}
	err = yaml.Unmarshal(content, &config)
	return &config, err
}
